#ifndef CCOLOR_H_
#define CCOLOR_H_

#include <ostream>
#include <sstream>
#include "../base/cobject.h"

using namespace std;

/**
 * CColor - class with information about color combination
 * @author Michal Rost
 * @date 20.07.2007
 */
class CColor : public CObject {
public:
  CColor();
  CColor(int r, int g, int b);
  CColor(float r, float g, float b);
  CColor(unsigned char r, unsigned char g, unsigned char b);
  CColor(int hex);
  void setR(unsigned char r);
  void setG(unsigned char g);
  void setB(unsigned char b);
  unsigned char getR() const;
  unsigned char getG() const;
  unsigned char getB() const;
  int toHex();
  void inHex(int hex);
  CColor toGrayscale();
  string toString() const;
  static string getClassName() {
    return "CColor";
  }
  static int toHex(CColor dec);
  static CColor toGrayscale(CColor rgb);
protected:
  unsigned char r, g, b;
  void init(unsigned char r, unsigned char g, unsigned char b);
};

#endif
